package com.scoy.honeymei.base;

import android.content.Context;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;

import com.scoy.honeymei.MeApp;

/**
 * @ClassName: BaseFragment$
 * @Description:
 * @Author: GaoZhan
 * @CreateDate: 2019/8/26/0026$ 下午 15:43$
 * @UpdateUser: 更新者
 * @UpdateDate: 2019/8/26/0026$ 下午 15:43$
 * @UpdateRemark: 更新内容
 */
public abstract class BaseFragment extends Fragment {


    private FragmentActivity activity;

    public abstract void initNormal();

    /**
     * 获取activity
     *
     * @return this
     */
    public Context getContext() {
        if (activity == null) {
            return MeApp.getInstance();
        }
        return activity;
    }

    @Override
    public void onAttach(Context context) {
        super.onAttach(context);
        activity = getActivity();
    }
}
